<template>
	<!-- 工商信息 -->
	<view class="box">
		<view class="tou top" :style="'padding-top:' + statusBarHeight1 + 'px'">
			<image @click="fanhui" src="https://pic.bangbangtongcheng.com/static/fanhui_bai.png" />工商信息
		</view>
		<view class="center">
			<view class="title">
				登记信息
			</view>
			<view class="danhang">
				<view class="biaoti">
					法定代表人
				</view>
				<view class="neir">
					{{data.operName}}
				</view>
			</view>
			<view class="danhang">
				<view class="biaoti">
					注册资本
				</view>
				<view class="neir">
					{{data.registCapi}}
				</view>
			</view>
			<view class="binhang">
				<view class="label">
					<view class="biaoti">
						经营状态
					</view>
					<view class="neir">
						{{data.status}}
					</view>
				</view>
				<view class="label">
					<view class="biaoti">
						成立日期
					</view>
					<view class="neir">
						{{data.startDate}}
					</view>
				</view>
			</view>
			<view class="binhang">
				<view class="label">
					<view class="biaoti">
						企业类型
					</view>
					<view class="neir">
						{{data.econKind}}
					</view>
				</view>
				<!-- <view class="label">
					<view class="biaoti">
						参保人数
					</view>
					<view class="neir">
						19
					</view>
				</view> -->
			</view>
			<view class="binhang">
				<view class="label">
					<view class="biaoti">
						所属行业
					</view>
					<view class="neir">
						{{qyxz(data.entType)}}
					</view>
				</view>
				<view class="label">
					<view class="biaoti">
						所属地区
					</view>
					<view class="neir" v-if="data.area">
						{{data.area.province}}
					</view>
				</view>
			</view>
			<view class="danhang">
				<view class="biaoti">
					统一社会信用代码
				</view>
				<view class="neir">
					{{data.creditCode}}
				</view>
			</view>
			<view class="danhang">
				<view class="biaoti">
					工商注册号
				</view>
				<view class="neir">
					{{data.no}}
				</view>
			</view>
			<view class="binhang">
				<view class="label">
					<view class="biaoti">
						经营期限
					</view>
					<view class="neir">
						{{data.teamEnd || '-'}}
					</view>
				</view>
				<view class="label">
					<view class="biaoti">
						核准日期
					</view>
					<view class="neir">
						{{data.checkDate}}
					</view>
				</view>
			</view>
			<view class="danhang">
				<view class="biaoti">
					登记状态
				</view>
				<view class="neir">
					{{data.status}}
				</view>
			</view>
			<view class="danhang">
				<view class="biaoti">
					注册地址
				</view>
				<view class="neir">
					{{data.address}}
				</view>
			</view>
			<view class="danhang" style="margin-bottom: 0;padding-bottom: 40rpx;">
				<view class="biaoti">
					经营范围
				</view>
				<view class="neir">
					{{data.scope}}
				</view>
			</view>
		</view>
		<uniBall></uniBall>
	</view>
</template>
<script>
	import permision from "@/js_sdk/wa-permission/permission.js"
	//#ifdef H5
	import wxshare from "@/utils/index.js";
	//#endif
	import {
		mapGetters
	} from "vuex";
	export default {
		data() {
			return {
				id:'',
				creditCode:'',
				data:{}
			};
		},
		onLoad(options) {
			this.id = options.id
			this.creditCode = options.creditCode
			this.getData()
			/* #ifdef H5 */
			this.jinzhi();
			/* #endif */
		},
		computed: {
			...mapGetters(["statusBarHeight1", "userinfo"])
		},
		methods: {
			// 获取企业性质
			qyxz(index){
				if(index == 1){
					return '社会组织'
				}else if(index ==3){
					return '中国香港公司'
				}else if(index ==4){
					return '事业单位'
				}else if(index ==5){
					return '中国台湾公司'
				}else if(index ==6){
					return '基金会'
				}else if(index ==7){
					return '医院'
				}else if(index ==8){
					return '海外公司'
				}else if(index ==9){
					return '律师事务所'
				}else if(index ==10){
					return '学校'
				}else if(index ==11){
					return '机关单位'
				}else if(index == 0){
					return '大陆企业'
				}else{
					return '其他'
				}
			},
			// 获取工商信息
			getData(){
				let that = this
				this.$myRequest.get("/api/mobile/personnelOwner/getBusinessAdministration", {
					enterpriseCertificationId:this.id,
					keyword:this.creditCode
				}).then(res => {
					this.data = res.businessAdministration
				});
			},
			jinzhi() {
				let _this = this;
				let param = window.location.href.split("#")[0];
				uni.request({
					method: "post",
					data: {
						url: param
					},
					header: {
						"content-type": "application/x-www-form-urlencoded"
					},
					url: "https://www.bangbangtongcheng.com/conven//mob/login/getJsTicket.do",
					success(re) {
						_this.jinzhifx(re.data);
					}
				});
			},
			jinzhifx(data) {
				wxshare.config({
					debug: false, //是否打开调试
					appId: data.appId, // 公众号的唯一标识
					timestamp: data.timestamp, // 生成签名的时间戳
					nonceStr: data.nonce, // ，生成签名的随机串
					signature: data.signature, // 签名
					jsApiList: ["hideMenuItems"]
				});
				// 禁止分享
				wxshare.hideMenuItems({
					// 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
					menuList: [
						"menuItem:share:appMessage",
						"menuItem:share:timeline",
						"menuItem:share:timeline",
						"menuItem:share:qq",
						"menuItem:favorite",
						"menuItem:share:QZone",
						"menuItem:openWithSafari"
					]
				});
			},
			fanhui() {
				uni.navigateBack({
					delta: 1
				});
			}
		}
	};
</script>
<style lang="less" scoped>
	.box {
		min-height: 100vh;
		background-color: #25312F;
	}

	.tou {
		position: relative;
		width: 100%;
		text-align: center;
		line-height: 88rpx;
		font-size: 36rpx;
		color: #fff;
		background-color: #64b6a8;

		image {
			position: absolute;
			width: 32rpx;
			height: 32rpx;
			// top: 116rpx;
			left: 30rpx;
		}
	}

	.center {
		padding: 0 30rpx;
		margin-top: 40rpx;
		color: #FFFFFF;

		.title {
			font-size: 34rpx;
			font-weight: 600;
			margin-bottom: 20rpx;
		}

		.danhang {
			margin-bottom: 40rpx;

			.biaoti {
				font-size: 24rpx;
				font-weight: 400;
				color: #ADADAD;
				margin-bottom: 8rpx;
			}

			.neir {
				font-size: 24rpx;
				font-weight: 600;
			}
		}
		.binhang {
			margin-bottom: 40rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.label {
				flex: 1;

				.biaoti {
					font-size: 24rpx;
					font-weight: 400;
					color: #ADADAD;
					margin-bottom: 8rpx;
				}

				.neir {
					font-size: 24rpx;
					font-weight: 600;
				}
			}
		}
	}
</style>